package com.xunlai.infra.permission.manager.web.converter;

import com.xunlai.infra.permission.manager.web.vo.role.*;
import com.xunlai.infra.permission.storage.entity.Role;
import com.xunlai.infra.permission.storage.entity.RolePermission;
import com.xunlai.infra.permission.storage.entity.RoleRelation;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author liang
 * @date 12/11/22 6:45 PM
 */
@Mapper
public interface RoleConverter {

    RoleConverter INSTANCE = Mappers.getMapper(RoleConverter.class);

    Role convertCreateReq2Role(CreateRoleReqVo roleReqVo);

    RoleRelation convertCreateReq2RoleRelation(CreateRoleRelationVo createRoleRelationVo);

    RolePermission convertCreateReq2RolePermission(CreateRolePermissionReqVo createRolePermissionReqVo);

    Role convertQueryReq2Role(QueryRoleReqVo queryRoleReqVo);

    RoleListVo convert2RoleListVo(Role role);
}
